//
//  GlobalConfig.h
//  BonweBuy
//
//  Created by liuxin on 2020/2/24.
//  Copyright © 2020 liuxin. All rights reserved.
//

#ifndef GlobalConfig_h
#define GlobalConfig_h

#define ImageBaseURL @"https://pic.bonwebuy.com"
#define ImageNamed(_pointer) [UIImage imageNamed:_pointer]

#define ImageWithURL(_pointer) [_pointer hasPrefix:@"http"] ? [NSString stringWithFormat:@"%@", _pointer] : [NSString stringWithFormat:@"%@%@", ImageBaseURL,_pointer]

#define SCREEN_WIDTH        [[UIScreen mainScreen] bounds].size.width          //屏幕宽度
#define SCREEN_HEIGHT       [[UIScreen mainScreen] bounds].size.height        //屏幕高度
#define TRUE_STATUSBAR_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height //真实的状态栏高度
#define STATUSBAR_HEIGHT (TRUE_STATUSBAR_HEIGHT > 40.0 ? 44.0 : 20.0) //状态栏高度(由于热电模式下状态栏高度为20 + 20)
#define TABBAR_HEIGHT ((STATUSBAR_HEIGHT > 20.0) ? 83.0 : 49.0)    //底部tabbar高度
#define TABBAR_MAX_Y  (TABBAR_HEIGHT - 49.0)                        //tabbar的最大Y值

#define kAppWidth_6(x) (SCREEN_WIDTH / 375.0 * (x))                // 跟据375屏幕做适配
#define kAppWidth_Mini(x) (SCREEN_WIDTH / 1080.0 * (x))          // 根据1080做适配

//  颜色
#define  UICOLOR_HEX(hexColor) \
[UIColor colorWithRed: (((hexColor >> 16) & 0xFF)) / 255.0f green: (((hexColor >> 8) & 0xFF)) / 255.0f blue: ((hexColor & 0xFF)) / 255.0f alpha:1.0f]
#define kAppGaryColor                    UICOLOR_HEX(0xE3E4E5) 

/*
苹方-简 中黑体 PingFangSC-Medium
苹方-简 中粗体 PingFangSC-Semibold
苹方-简 细体 PingFangSC-Light
苹方-简 极细体 PingFangSC-Ultralight
苹方-简 常规体 PingFangSC-Regular
苹方-简 纤细体 PingFangSC-Thin
*/
#define UIPFLightFont(CGFloat) [UIFont fontWithName:@"PingFangSC-Light" size:kAppWidth_6(CGFloat)]
#define UIPFRegularFont(CGFloat) [UIFont fontWithName:@"PingFangSC-Regular" size:kAppWidth_6(CGFloat)]
#define UIPFMediumFont(CGFloat) [UIFont fontWithName:@"PingFang-SC-Medium" size:kAppWidth_6(CGFloat)]
#define UIPFBoldFont(CGFloat) [UIFont fontWithName:@"PingFang-SC-Bold" size:kAppWidth_6(CGFloat)]
#define UIPFSemBoldFont(CGFloat) [UIFont fontWithName:@"PingFangSC-Semibold" size:kAppWidth_6(CGFloat)]
#define UIPFUltralightFont(CGFloat) [UIFont fontWithName:@"PingFangSC-Ultralight" size:kAppWidth_6(CGFloat)]
#define UIPFThinFont(CGFloat) [UIFont fontWithName:@"PingFangSC-Thin" size:kAppWidth_6(CGFloat)]

//获取根视图控制器进行跳转
#define kTabbarPushVC(a)    {\
if ([self getCurrentVC].navigationController) {\
a.hidesBottomBarWhenPushed = YES;\
[[self getCurrentVC].navigationController pushViewController:a animated:YES];\
}else{\
[[self getCurrentVC] presentViewController:a animated:YES completion:nil];\
}\
}



typedef enum : NSUInteger {
    KeyBoardTypeNormal = 0,         //正常
    KeyBoardTypeNumber,              //纯数字
    KeyBoardTypeDecimal
} KeyBoardType;

#endif /* GlobalConfig_h */
